/** @format */

import React from 'react';
import {footer} from './index.styl';

interface IState {
  hostname: string;
}

interface IProps {
  [propName: string]: any;
}

class Footer extends React.Component<IProps, IState> {
  constructor(props: IProps) {
    super(props);
    this.state = {hostname: ''};
  }

  componentDidMount() {
    this.setState({hostname: location.hostname});
  }

  render(): JSX.Element {
    return (
      <footer className={footer}>
        <p>
          Copyright © {new Date().getFullYear()} {this.state.hostname} 蜀ICP备18018763号
        </p>
      </footer>
    );
  }
}

export default Footer;
